package com.dinnerorders.common.utils;

public class MessageBuilder {
    private static final StringBuilder builder = new StringBuilder();

    /**
     * Builds String message from parts
     */
    public static String buildMessage (String ... parts) {
        flush();
        for (String part : parts) {
            builder.append(part);
        }
        return builder.toString();
    }

    private static void flush() {
        builder.delete(0, builder.length());
    }
}
